// ml:run = $bin < input
#include <iostream>
#include <map>
#include <string>

std::string d1, d2;

int main()
{
    std::ios_base::sync_with_stdio(false);
    std::map<std::string, int> week{{"monday", 1}, {"tuesday", 2},
        {"wednesday", 3}, {"thursday", 4}, {"friday", 5}, {"saturday", 6},
        {"sunday", 0}
    };
    std::cin >> d1 >> d2;
    int t1 = week[d1];
    int t2 = week[d2];
    int a[3] = {28, 30, 31};
    if ((t1 + a[0]) % 7 == t2 ||
            (t1 + a[1]) % 7 == t2 ||
                (t1 + a[2]) % 7 == t2)
        std::cout << "YES\n";
    else
        std::cout << "NO\n";
}

